Declaration Editor

The Declaration Editor lists all signals that are used in TPT to observe or stimulate a SUT. Get an overview of the different signal types, see Signal Types.

Declaration Editor

The menu bar, the toolbar, the signal table and the various tabs located in the editor are described below.

Menu bar

File

Import interface / declarations (Ctrl+I)

Opens the Import Interface dialog. Interface information from different sources can be imported, see Import Interface.

Export interface / declarations (Ctrl+O)

The declarations from the Declaration Editor can be exported to the following file formats: TPTAIF, XML, XLSX.

The XLSX file must contain the columns Name, Type, and Data Type.

Import equivalence class sets

Equivalence class sets can be imported. The imported file must be stored to an XLS/ XLSX file, see Export and Import Equivalence Class Set.

Export equivalence class sets

Equivalence class sets can be exported to an XLSX file format, see Export and Import Equivalence Class Set.

View

Refresh (F5)

Updates the declarations in the Declaration Editor.

Tools

Type Editor (Ctrl+T)

Opens the Type Editor. In the Type Editor you can create custom data types for signals, see Type Editor.

Unit Editor (Ctrl+U)

Opens the Unit Editor. In the Unit Editor, you can create and customize units, see Unit Editor.

Mapping Editor (Ctrl+Shift+M)

Opens the Mapping Editor. If the attributes of the variables for the test differ from the attributes of the variables of the system under test you can specify a mapping, see Declarations - Mappings.

Equivalence Class Sets Editor (Ctrl+E)

Opens the Edit Equivalence Class Set dialog, see Create an Equivalence Class Set.

Rename Selection

Opens the Rename Signals dialog, see Edit Declarations.

Toolbar

Toolbar in the Declaration Editor

Signal types

Click one of the Add icons to create a signal type. When you create a new channel, for example channel and you select it and click Create new channel, then TPT creates a new channel with the name channel_001. It uses the same name but increases the number by 1. The new channel has the same data type and the same default value as channel. This also applies to parameters, measurements, constants, and assessment variables.

To delete a signal, select it in the signal table and click Delete selected item .

Refactoring

Enables or disables the refactoring feature (shortcut Ctrl+R). By default, this feature is enabled . To disable it by default, go to Options|Preferences|General settings and deselect the Refactor on signal name checkbox.

Whenever you change the name of a declaration and this feature is enabled, the complete TPT model will be refactored. All source code locations where the old name appears as an identifier are replaced by the new name.

Refactoring will have no effect in the MATLAB view, the Dashboard script, the Custom Script Execution of the TPT test environment settings, and not on comments and strings.

Thus, when you use a signal in a function that requires to place an expression in strings, like TPT.eval(), this function would fail after the refactoring. Use the replace function of the global or local search, see Search.

To prevent functions that share the same name as a signal from being renamed during refactoring, use the Search feature of TPT and give the functions a unique name.

Refactoring is also possible during interface import, see Import Interface.

Expand/collapse a selection

Expands or collapses the elements of non-primitive data types, see (1) in Figure " Toolbar in the Declaration Editor".

Mapping

A mapping can be selected from the drop-down list to edit its content for individual signals, see Declarations - Mappings and see (2) in Figure " Toolbar in the Declaration Editor".

Value representation

Change value representation (decimal, binary, hexadecimal), see (3) in Figure " Toolbar in the Declaration Editor".

Select unused declarations

Click on Select unused to automatically select signals which are not used in the project.

Select unused declarations

Test model only

Click to select all channels and parameters that are not used in your test model.

Test model incl. assessments

Click to select all channels and parameters not used in the test model and all measurements and assessment variables.

Filter/search settings

To filter the signals depending on their types, click on the corresponding icon. Additionally, you can filter the signals depending on their channel mode by clicking on the arrow icon, see Figure " Mode list".

Mode list

To filter and search the signals depending on their names, enter a term in the text field, see (1) in Figure " Mode list". To activate the use of regular expressions for search and filter, select Regular Expressions. For example, the term ^L.*(g|y)$ will search a signal that begins with an L and ends with an g or an y. The search is not case-sensitive.

The selected settings (Regular Expressions, Filter, Search) are retained, see Figure " Toolbar in the Declaration Editor".

Signal Table

The signal table shows all declared TPT signals. The signal names can be copied from the Declaration Editor by right-clicking on a line and selecting Copy Name (shortcut Ctrl+ ALT+C).

Names can be copied; use the right-click on a name

By default, the declarations are sorted by name. It is possible to sort any column by clicking on the corresponding heading in the table header row. To display additional columns, click the icon. With the option Pack All Columns and Pack Selected Column you can refresh the column width to adapt to the content length.

Additional columns

When you have selected a mapping, use the icon to select the mapping flavor columns to be displayed; notice also the Show All Mapping Columns option.

All Scaling Flavor columns are selected

Click inside a column's field to edit its content. For more information, see Edit Declarations.

Tabs View

By default, the tabs view section displays the General and Equivalence Class Set tabs, see Edit Declarations and Create an Equivalence Class Set.

For each mapping flavor in your mapping, a new tab is displayed. These tabs are only shown when you select a mapping from the Mapping drop-down list.